// 类似vue中的main.js 入口文件
import React, { Component } from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
// 确定路由模式-HashRouterProps（有#）或者BrowserRouter就是常用的history模式
import { BrowserRouter } from 'react-router-dom';
import App from './App';
import reportWebVitals from './reportWebVitals';
// 这里应该引入自己配置好的axios
import axios from './http'
// 添加到基类中，这个基类会被所有的组件继承，所以全局可用
Component.prototype.http = axios;


const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
    <BrowserRouter>
        <App />
    </BrowserRouter>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
